import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;
import javax.swing.JTable;
import javax.swing.JScrollBar;
import javax.swing.JScrollPane;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;


public class TwoTablesMoreTwoButtons extends JFrame {

	private JPanel contentPane;
	private JTable table;
	private JTable table_1;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					TwoTablesMoreTwoButtons frame = new TwoTablesMoreTwoButtons();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public TwoTablesMoreTwoButtons() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 353, 371);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JButton btnB = new JButton("B1");
		btnB.setBounds(10, 11, 50, 45);
		contentPane.add(btnB);
		
		JScrollPane scrollPane = new JScrollPane();
		scrollPane.setBounds(84, 11, 234, 120);
		contentPane.add(scrollPane);
		
		Object[] nameCol = {"1","2"};	
		
		
		Object[][] data = {
				
				{"Mary", "Campione"},
				{"Lhucas", "Huml"},
				{"Kathya", "Walrath"},
				{"Marcus", "Andrews"},
				{"Angela", "Lalth"}
		};
		
		table = new JTable(data,nameCol);
		scrollPane.setViewportView(table);
		
		Object[] nameCol2 = {"1","2"};	
		
		
		Object[][] data2 = {
				
				{"Mary", "Campione"},
				{"Lhucas", "Huml"},
				{"Kathya", "Walrath"},
				{"Marcus", "Andrews"},
				{"Angela", "Lalth"}
		};
		
		JButton btnB_1 = new JButton("B2");
		btnB_1.setBounds(10, 138, 50, 45);
		contentPane.add(btnB_1);
		
		JScrollPane scrollPane_1 = new JScrollPane();
		scrollPane_1.setBounds(84, 142, 234, 122);
		contentPane.add(scrollPane_1);
		
		table_1 = new JTable(data2,nameCol2);
		scrollPane_1.setViewportView(table_1);
		
		JButton btnClose = new JButton("Close");
		btnClose.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				
				new Main().setVisible(true);
				dispose();
			}
		});
		btnClose.setBounds(229, 278, 89, 23);
		contentPane.add(btnClose);
		
	
	}
}
